Skip to content

Conversation

@andystaples
Copy link
Contributor

Updates the signature of EntityInstanceId.parse to reflect that it will always either return or throw. Also updates corresponding usages in the SDK

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the EntityInstanceId.parse method signature to reflect that it always returns an EntityInstanceId or throws a ValueError, rather than returning Optional[EntityInstanceId]. The changes update all call sites to use try-except blocks instead of checking for None.

  • Changed method signature from Optional[EntityInstanceId] to EntityInstanceId
  • Updated three usage sites to catch ValueError instead of checking for None return
  • Improved error handling consistency across the SDK

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
durabletask/entities/entity_instance_id.py Updated parse method return type signature from Optional[EntityInstanceId] to EntityInstanceId
durabletask/worker.py Updated two call sites to use try-except blocks for ValueError instead of checking for None
durabletask/entities/entity_metadata.py Updated from_entity_response method to catch ValueError from parse instead of checking for None

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants